<template>
	<view class="first-inspectino-list">
		<u-navbar :is-back="false" title="首页"></u-navbar>
		<view class="search-wraper">
			<u-search placeholder="请输入号码号牌" v-model="keyword"></u-search>
		</view>
		<u-table>
			<u-tr>
				<u-th>学校</u-th>
				<u-th>班级</u-th>
				<u-th>年龄</u-th>
			</u-tr>
			<u-tr>
				<u-td>浙江大学</u-td>
				<u-td>05班</u-td>
				<u-td>22</u-td>
			</u-tr>
			<u-tr>
				<u-td>清华大学</u-td>
				<u-td>05班</u-td>
				<u-td>20</u-td>
			</u-tr>
		</u-table>
		<u-gap height="80" bg-color="#fff"></u-gap>
		<view style="padding: 0 20rpx;">
			<u-button type="primary" @click="plateShow = true" class="u-font-bold">打开</u-button>
		</view>
		<plate-input @typeChange="typeChange" v-if="plateShow" :plate="plateNo" @export="setPlate"
			@close="plateShow = false & close()" />
	</view>
</template>

<script>
	import PlateInput from '@/components/PlateInput/index.vue';
	export default {
		components: {
			PlateInput,
		},
		data() {
			return {
				keyword: "",
				plateNo: '',
				plateShow: false
			}
		},
		methods: {
			setPlate(plate) {
				console.log(plate)
				if (plate.length >= 7) this.plateNo = plate;
				this.plateShow = false;
			},
			typeChange(e) {
				console.log(e);
				this.PageCur = e;
				this.plateNo = '';
			},
			close() {
				this.PageCur = 1;
			}
		}
	}
</script>

<style lang="scss">
	.first-inspectino-list {

		.search-wraper {
			background-color: #fff;
			padding: 20rpx 32rpx;
		}
	}
</style>
